package lab4p1;

/**
 * <p>Title: Part1</p>
 * <p>Description: CS 235 Lab #4</p>
 *         A simple Java program that shows how to check hash codes of String objects.
 * @author Anthony Varghese
 * @date   August 8th 2013
 * @team   
 */

public class Part1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String x = "Hello";
		String y = "GoodBye";
		
		System.out.println("   String x has " + x + " and hashcode: " + x.hashCode() );
		System.out.println("   String y has " + y + " and hashcode: " + y.hashCode() );

		int p = x.indexOf('a');
		System.out.println("After x.indexOf('a') == " + p );
		System.out.println("   String x has " + x + " and hashcode: " + x.hashCode() );
		
		x = x + y;
		System.out.println("After + operation:" );
		System.out.println("   String x has " + x + " and hashcode: " + x.hashCode() );

		x = x.concat( "Something" );
		System.out.println("After x.concat:" );
		System.out.println("   String x has " + x + " and hashcode: " + x.hashCode() );
		
		p = x.indexOf('t');
		System.out.println("After x.indexOf('t') == " + p );
		System.out.println("   String x has " + x + " and hashcode: " + x.hashCode() );
	}
}
